Skip to content

feat: warn on stale/orphaned connectors in tunnel list#2

Open
drewr wants to merge 1 commit into
feat/init-connect-pluginfrom
feat/stale-connector-warnings
Open

feat: warn on stale/orphaned connectors in tunnel list#2
drewr wants to merge 1 commit into
feat/init-connect-pluginfrom
feat/stale-connector-warnings

Conversation

@drewr

@drewr drewr commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Important

This PR depends on #1 and should be merged after it.

Summary

datumctl connect tunnel list now surfaces connector health so users can spot stale or orphaned connectors without needing to run a separate datumctl get connectors command.

New CONNECTOR column

Each tunnel row gains a CONNECTOR column showing ok (lease active) or stale (lease expired — agent is offline, traffic will be dropped).

Orphaned connector section

Connectors that exist in the project but are not referenced by any tunnel are shown in a separate section at the bottom of the table. These are typically left over from a tunnel agent that exited uncleanly.

ID            LABEL           ENDPOINT               STATUS  ENABLED  CONNECTOR  HOSTNAMES
--            -----           --------               ------  -------  ---------  ---------
tunnel-jflkj  localhost:8888  http://localhost:8888  ready   yes      ok         certain-come-k328k.prism.staging.env.datum.net
tunnel-nzwjp  localhost:3902  http://localhost:3902  ready   yes      ok         hyphen-seize-vc297.prism.staging.env.datum.net

ORPHANED CONNECTORS (no tunnel — safe to delete)
NAME                  STATUS
----                  ------
datum-connect-wk4sc   stale

Changes

  • connect-lib/lib/src/tunnels.rs: TunnelSummary gains connector_ready and connector_name fields; new OrphanedConnector struct; new list_project_with_orphans and list_active_with_orphans methods that fetch all Connectors in one extra API call
  • connect-lib/bin/src/main.rs: Commands::List uses list_active_with_orphans, emits connector field and orphaned_connector entries in JSON output
  • connect-plugin/internal/output/convert.go: RenderTable adds CONNECTOR column and renders orphaned connector section

Tunnels whose connector lease has expired show 'stale' in a new
CONNECTOR column. Connectors that have no associated tunnel (left
over from an unclean shutdown) are shown in a separate ORPHANED
CONNECTORS section at the bottom of the table.

Changes:
- TunnelSummary gains connector_ready and connector_name fields
- New OrphanedConnector struct
- list_project_with_orphans() fetches all Connectors in one extra
  API call, joins Ready status onto each tunnel, and collects any
  Connector not referenced by a tunnel as an orphan
- Commands::List uses list_active_with_orphans(); emits
  connector field ('ok'/'stale') and orphaned_connector entries
- RenderTable adds CONNECTOR column and orphan section
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant